Ring filter
Contents
Ring filter#
Calculations#
For a ring resonator we need to define:
Optical parameters:
coupling coefficient: will define resonance extinction ratio for a particular ring loss.
Free spectral range.
Electrical parameters:
VpiL
Resistance
[1]:
import numpy as np
import gdsfactory as gf
gf.config.rich_output()
PDK = gf.get_generic_pdk()
PDK.activate()
def ring(
wl: np.ndarray,
wl0: float,
neff: float,
ng: float,
ring_length: float,
coupling: float,
loss: float,
) -> np.ndarray:
"""Returns Frequency Domain Response of an all pass filter.
Args:
wl: wavelength in um.
wl0: center wavelength at which neff and ng are defined.
neff: effective index.
ng: group index.
ring_length: in um.
loss: dB/um.
"""
transmission = 1 - coupling
neff_wl = (
neff + (wl0 - wl) * (ng - neff) / wl0
) # we expect a linear behavior with respect to wavelength
out = np.sqrt(transmission) - 10 ** (-loss * ring_length / 20.0) * np.exp(
2j * np.pi * neff_wl * ring_length / wl
)
out /= 1 - np.sqrt(transmission) * 10 ** (-loss * ring_length / 20.0) * np.exp(
2j * np.pi * neff_wl * ring_length / wl
)
return abs(out) ** 2
if __name__ == "__main__":
import matplotlib.pyplot as plt
loss = 0.03 # [dB/μm] (alpha) waveguide loss
neff = 2.46 # Effective index of the waveguides
wl0 = 1.55 # [μm] the wavelength at which neff and ng are defined
radius = 5
ring_length = 2 * np.pi * radius # [μm] Length of the ring
coupling = 0.5 # [] coupling of the coupler
wl = np.linspace(1.5, 1.6, 1000) # [μm] Wavelengths to sweep over
wl = np.linspace(1.55, 1.60, 1000) # [μm] Wavelengths to sweep over
ngs = [4.182551, 4.169563, 4.172917]
thicknesses = [210, 220, 230]
# widths = np.array([0.4, 0.45, 0.5, 0.55, 0.6])
# ngs = np.array([4.38215238, 4.27254985, 4.16956338, 4.13283219, 4.05791982])
widths = np.array([0.495, 0.5, 0.505])
neffs = np.array([2.40197253, 2.46586378, 2.46731758])
ng = 4.2 # Group index of the waveguides
for width, neff in zip(widths, neffs):
p = ring(
wl=wl,
wl0=wl0,
neff=neff,
ng=ng,
ring_length=ring_length,
coupling=coupling,
loss=loss,
)
plt.plot(wl, p, label=f"{int(width*1e3)}nm")
plt.title("ring resonator vs waveguide width")
plt.xlabel("wavelength (um)")
plt.ylabel("Power Transmission")
plt.grid()
plt.legend()
plt.show()
2023-02-20 18:00:24.791 | INFO | gdsfactory.config:<module>:50 - Load '/home/runner/work/gdsfactory/gdsfactory/gdsfactory' 6.43.1
2023-02-20 18:00:25.667 | INFO | gdsfactory.technology.layer_views:__init__:785 - Importing LayerViews from YAML file: /home/runner/work/gdsfactory/gdsfactory/gdsfactory/generic_tech/layer_views.yaml.
2023-02-20 18:00:25.674 | INFO | gdsfactory.pdk:activate:206 - 'generic' PDK is now active
Layout#
gdsfactory easily enables you to layout Component with as many levels of hierarchy as you need.
A Component is a canvas where we can add polygons, references to other components or ports.
Lets add two references in a component.
[2]:
from typing import Optional
import toolz
from omegaconf import OmegaConf
from gdsfactory.component import Component
from gdsfactory.components.bend_euler import bend_euler
from gdsfactory.components.coupler90 import coupler90 as coupler90function
from gdsfactory.components.coupler_straight import (
coupler_straight as coupler_straight_function,
)
from gdsfactory.components.straight import straight
from gdsfactory.cross_section import strip
from gdsfactory.snap import assert_on_2nm_grid
from gdsfactory.typings import ComponentSpec, CrossSectionSpec
import gdsfactory as gf
c = gf.components.ring_single_heater(gap=0.2, radius=10, length_x=4)
c
ring_single_heater_leng_4dbcc1ad: uid 7a9e2cc3, ports ['o2', 'o1', 'e1', 'e2'], references ['coupler_ring_1', 'straight_1', 'straight_2', 'bend_euler_1', 'bend_euler_2', 'straight_3', 'via_stack_1', 'via_stack_2'], 0 polygons
[3]:
scene = c.to_3d()
scene.show()
[3]:
Lets define a ring function that also accepts other component specs for the subcomponents (straight, coupler, bend)
[4]:
ring = gf.components.ring_single_heater(gap=0.2, radius=10, length_x=4)
ring_with_grating_couplers = gf.routing.add_fiber_array(ring)
ring_with_grating_couplers
ring_single_heater_leng_eeb0a50c: uid ef33affb, ports ['e1', 'e2', 'opt-grating_coupler_ellipti_dd7f7af4-ring_single_heater_leng_4dbcc1ad-o1', 'opt-grating_coupler_ellipti_dd7f7af4-ring_single_heater_leng_4dbcc1ad-o2', 'opt-grating_coupler_ellipti_dd7f7af4-ring_single_heater_leng_4dbcc1ad-loopback0', 'opt-grating_coupler_ellipti_dd7f7af4-ring_single_heater_leng_4dbcc1ad-loopback1'], references ['bend_euler_1', 'straight_1', 'straight_2', 'bend_euler_2', 'straight_3', 'straight_4', 'bend_euler_3', 'bend_euler_4', 'bend_euler_5', 'bend_euler_6', 'bend_euler_7', 'bend_euler_8', 'straight_5', 'straight_6', 'straight_7', 'straight_8', 'straight_9', 'grating_coupler_elliptical_trenches_1', 'grating_coupler_elliptical_trenches_2', 'grating_coupler_elliptical_trenches_3', 'grating_coupler_elliptical_trenches_4', 'ring_single_heater_1'], 0 polygons
[5]:
gf.routing.add_electrical_pads_top_dc(ring_with_grating_couplers)
ring_single_heater_leng_16b22756: uid 14c75129, ports ['opt-grating_coupler_ellipti_dd7f7af4-ring_single_heater_leng_4dbcc1ad-o1', 'opt-grating_coupler_ellipti_dd7f7af4-ring_single_heater_leng_4dbcc1ad-o2', 'opt-grating_coupler_ellipti_dd7f7af4-ring_single_heater_leng_4dbcc1ad-loopback0', 'opt-grating_coupler_ellipti_dd7f7af4-ring_single_heater_leng_4dbcc1ad-loopback1', 'elec-ring_single_heater_leng_eeb0a50c-1', 'elec-ring_single_heater_leng_eeb0a50c-2'], references ['add_fiber_array_1', 'pad_array_1', 'wire_corner_1', 'wire_corner_2', 'straight_1', 'straight_2', 'straight_3', 'wire_corner_3', 'wire_corner_4', 'straight_4', 'straight_5', 'straight_6'], 0 polygons
[6]:
gf.routing.add_electrical_pads_top(ring_with_grating_couplers)
ring_single_heater_leng_ae061274: uid 6c347db6, ports ['o2', 'o3', 'o1', 'o4', 'elec-ring_single_heater_leng_eeb0a50c-2', 'elec-ring_single_heater_leng_eeb0a50c-1'], references ['add_fiber_array_1', 'pad_array_1', 'route_quad_1', 'route_quad_2'], 0 polygons
Top reticle assembly#
Once you have your components and circuits defined, you can add them into a top reticle Component for fabrication.
You need to consider:
what design variations do you want to include in the mask? You need to define your Design Of Experiment or DOE
obey DRC (Design rule checking) foundry rules for manufacturability. Foundry usually provides those rules for each layer (min width, min space, min density, max density)
make sure you will be able to test te devices after fabrication. Obey DFT (design for testing) rules. For example, if your test setup works only for fiber array, what is the fiber array spacing (127 or 250um?)
if you plan to package your device, make sure you follow your packaging guidelines from your packaging house (min pad size, min pad pitch, max number of rows for wire bonding …)
[7]:
nm = 1e-3
ring_te = toolz.compose(gf.routing.add_fiber_array, gf.components.ring_single)
gaps = [210 * nm, 220 * nm, 230 * nm]
rings = gf.grid([ring_te(gap=gap) for gap in gaps])
rings_heater = [
gf.components.ring_single_heater(gap=0.2, radius=10, length_x=4) for gap in gaps
]
rings_heater_with_grating_couplers = [
gf.routing.add_fiber_array(ring) for ring in rings_heater
]
rings_with_pads = [
gf.routing.add_electrical_pads_top(ring)
for ring in rings_heater_with_grating_couplers
]
@gf.cell
def reticle(size=(1000, 1000)):
c = gf.Component()
r = c << rings
m = c << gf.pack(rings_with_pads)[0]
m.xmin = r.xmax + 10
m.ymin = r.ymin
c << gf.components.seal_ring(c.bbox)
return c
m = reticle(cache=False)
m
reticle: uid d8bde64f, ports [], references ['grid_1', 'pack_0_5bbae07e_1', 'seal_ring_1'], 0 polygons
[8]:
nm = 1e-3
ring_te = toolz.compose(gf.routing.add_fiber_array, gf.components.ring_single)
rings = gf.grid([ring_te(radius=r) for r in [10, 20, 50]])
gaps = [210 * nm, 220 * nm, 230 * nm]
rings_heater = [
gf.components.ring_single_heater(gap=0.2, radius=10, length_x=4) for gap in gaps
]
rings_heater_with_grating_couplers = [
gf.routing.add_fiber_array(ring) for ring in rings_heater
]
rings_with_pads = [
gf.routing.add_electrical_pads_top(ring)
for ring in rings_heater_with_grating_couplers
]
@gf.cell
def reticle(size=(1000, 1000)):
c = gf.Component()
r = c << rings
m = c << gf.components.pack_doe(
gf.components.mzi,
settings=dict(delta_length=[100, 200]),
function=gf.routing.add_fiber_single,
)
m.xmin = r.xmax + 10
m.ymin = r.ymin
c << gf.components.seal_ring(c.bbox)
return c
m = reticle(cache=False)
m
reticle: uid 2228b6f7, ports [], references ['grid_1', 'pack_doe_1', 'seal_ring_1'], 0 polygons
[9]:
gdspath = m.write_gds_with_metadata(gdspath="mask.gds")
2023-02-20 18:00:31.022 | INFO | gdsfactory.component:_write_library:1704 - Wrote to 'mask.gds'
2023-02-20 18:00:31.509 | INFO | gdsfactory.component:write_gds_with_metadata:1799 - Write YAML metadata to 'mask.yml'
Make sure you save the GDS with metadata so when the chip comes back you remember what you have on it.
You can also save the labels for automatic testing.
[10]:
labels_path = gdspath.with_suffix(".csv")
gf.labels.write_labels.write_labels_klayout(gdspath=gdspath, layer_label=(66, 0))
2023-02-20 18:00:31.518 | INFO | gdsfactory.labels.write_labels:write_labels_klayout:95 - Wrote 0 labels to CSV /home/runner/work/gdsfactory/gdsfactory/docs/notebooks/workflow/mask.csv
PosixPath('mask.csv')
[11]:
mask_metadata = OmegaConf.load(gdspath.with_suffix(".yml"))
tm = gf.labels.merge_test_metadata(mask_metadata=mask_metadata, labels_path=labels_path)
[12]:
tm.keys()
dict_keys([])